//
//  ParserNearbyModel.m
//  ITrip
//
//  Created by 1564335 on 15-5-29.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "ParserNearbyModel.h"

@implementation ParserNearbyModel

- (void)dealloc
{
    [_name_zh_cn release];
    [_name_en release];
    [_descrip release];
    [_tips_html release];
    [_address release];
    [_image_url release];
    [_attraction_type release];
    [super dealloc];
}

- (instancetype)init:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.attraction_trip_tags = [NSMutableArray array];
        self.nearbyId = [dic[@"id"] integerValue];
        if (![dic[@"name_en"] isEqual:[NSNull null]]) {
            self.name_en = dic[@"name_en"];
        }
        self.name_zh_cn = dic[@"name_zh_cn"];
        self.descrip = dic[@"description"];
        self.tips_html = dic[@"tips_html"];
        self.photos_count = [[dic[@"photos_count"]stringValue] integerValue];
        self.attraction_trips_count = [[dic [@"attraction_trips_count"]stringValue] integerValue];
        self.attraction_type = dic[@"attraction_type"];
        self.address = dic[@"address"];
        self.image_url = dic[@"image_url"];

        NSArray *array = [dic objectForKey:@"attraction_trip_tags"];
        for (NSDictionary *dic in array) {
            ParserNearbyAttraction_trip_tags *parser = [[ParserNearbyAttraction_trip_tags alloc] init:dic];
            [self.attraction_trip_tags addObject:parser];
        }
    }
    return self;
}

//- (NSMutableArray *)attraction_trip_tags
//{
//    if (!_attraction_trip_tags) {
//        _attraction_trip_tags = [NSMutableArray arrayWithCapacity:0];
//    }
//    return _attraction_trip_tags;
//}

- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@""]) {
        
    }
}

- (id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}




@end
